import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-04-26
 * Time: 9:53
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int count = 0;
        while (num != 0) {
            if((num & 1) == 1) {
                count++;
            }
            num = num >>> 1;//num >>>= 1;
        }
        System.out.println(count);
    }
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num1 = scanner.nextInt();
        int num2 = scanner.nextInt();
        int minValue = num1 <= num2 ? num1 :num2;
        if(num2 % minValue == 0 && num1 % minValue == 0) {
            System.out.println(minValue);
            System.exit(0);
        }
        int Max = 1;
        for (int num = 1; num <= minValue ; num++) {
            if(num1 % num == 0 && num2 % num == 0) {
                Max = num;
            }
        }
        System.out.println(Max);
    }
    public static void main5(String[] args) {
        double sum = 0;
        for (int i = 1; i <= 100; i++) {
            int j = 1;
            sum += j*(1.0/i);
            j =-j;
        }
        System.out.println(sum);
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        for (int i = 100; i <= num ; i++) {
            int sum = 0;
            int j = i;
            while (j != 0) {
                sum += (j%10)*(j%10)*(j%10);
                j = j / 10;
            }if(sum == i) {
                System.out.println(i);
            }
        }
    }
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            for (int i = 0; i < a; i++) {
                for (int j = 0; j < a; j++) {
                    if (i == j) {
                        System.out.print('*');
                    } else if (i + j == a - 1) {
                        System.out.print('*');
                    } else {
                        System.out.print(' ');
                    }
                }
                System.out.println();
            }
           /* for(int i = 0 ;i < a; i++) {
                for(int j =0 ;j < a; j++) {
                    if(i + j == a-1) {
                        System.out.print('*');
                    }else {
                        System.out.print(' ');
                    }
                }
                System.out.println();*/
        }
    }

    public static void main2(String[] args) {
        int flg = 0;
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        if (num <= 1) {
            System.out.println("不是素数");
            System.exit(0);
        }
        for (int i = 2; i < num; i++) {
            if(num % i == 0) {
                System.out.println("不是素数");
                flg = 1;
                break;
            }
        }
        if (flg == 0) {
            System.out.println("是素数");
        }
    }
    public static void main1(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if(i % 10 == 9) {
                count++;
                System.out.println(i);
            }if(i / 10 >0 && (i / 10) % 10 == 9) {
                count++;
                System.out.println(i);
            }
        }
        System.out.println("共有:"+count);
    }
}
